Avoid updating registry when adding existing deps
authorAlex Crichton <alex@alexcrichton.com>
Thu, 21 Jul 2016 16:50:33 +0000 (09:50 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 30 Sep 2016 19:45:20 +0000 (12:45 -0700)
commitc0306a8abf6b1722ab3c8ea53cc211a3e1906f17
tree750dda200cfce0c96f47acd0930fa8e77977b383
parentd8936af1390ab0844e5e68b459214f2529c9f647
Avoid updating registry when adding existing deps

Cargo previously erroneously updated the registry whenever a new dependency was
added on a crate which already exists in the DAG. This commit fixes this
behavior by ensuring that if the new dependency matches a previously locked
version it uses that instead.

This commit involved a bit of refactoring around this logic to be a bit more
clear how the locking and "falling back to the registry" is happening.

Closes #2895
Closes #2931
src/cargo/core/registry.rs
src/cargo/ops/resolve.rs
tests/registry.rs